
def get_token():
    """
    从当前目录的token.txt文件中读取API Token

    :return: 读取到的Token字符串
    :raises FileNotFoundError: 当token.txt文件不存在时
    :raises Exception: 其他读取错误
    """
    TOKEN_FILE = "token.txt"
    try:
        with open(TOKEN_FILE, "r") as f:
            token = f.read().strip()
        print(f"✅ 从 {TOKEN_FILE} 成功读取Token")
        return token
    except FileNotFoundError:
        print(f"❌ 错误：未找到 {TOKEN_FILE} 文件")
        print("请在当前目录创建 token.txt 文件，内容为您的API Token")
        print("示例：")
        print("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.xxxxxx")
        print("程序将退出...")
        raise SystemExit(1)
    except Exception as e:
        print(f"❌ 读取Token文件时出错: {str(e)}")
        raise SystemExit(1)